// components/MyModel/index.js
Component({
  options: {
    multipleSlots: true, // 在组件定义时的选项中启用多slot支持
    // addGlobalClass: true,
    // externalClassesx: ["my-model", "main"]
  },
  properties: {
    showCancel: {
      type:Boolean,
      value: true
    },
    confirmText: {
      type: String,
      value: "确认"
    },
    cancelText: {
      type: String,
      value: "取消"
    },
  },
  data: {
    show: false
  },
  methods: {
    open() {
      this.setData({
        show: true
      })
    },
    close() {
      this.setData({
        show: false
      })
    },
    toConfirm() {
      this.triggerEvent("confirm")
    },
    toCancel() {
      this.triggerEvent("cancel")
    }
  }
})
